/**
 * @Author:周邱艳
 * @Date:2020/6/30
 * @Description:这是组合基本信息
 */
import React,{Component} from "react";
import { List } from 'antd-mobile';
import axios from "axios"
import {URL} from "../../../index";
const Item = List.Item;
let data=""
export default class BasicInformation extends Component{
    constructor(props) {
        super(props);
        this.state = {
            combinationList:[],
            disabled: false,
        }
        this.loadData = this.loadData.bind(this)

    }
    loadData(){
        axios({
            method:"GET",
            url:URL+"/combinationDynamicInfo/combinationDetailData",
            params:{comBaseId:this.props.fathercomBaseId}
        }).then(
            (res) => {
                //状态码判断
                if(res.data.code===200){
                    data = res.data
                    this.setState({})
                    //状态码判断
                }else if(res.data.code === 500){
                    this.props.history.push('/serverError')
                }
            }
        ).catch(function (error) {//异常处理
            console.log(error);
        })
    }
    //组件挂载后
    componentDidMount() {
        this.loadData()
    }

    render() {
        return (
            <div>
                <List className="my-list">
                    <Item extra={<p style={{fontSize:"1.8rem",color:"red"}}>{data.collectNum}</p>}
                          style={{fontSize:"2.5rem",color:"black"}}>收藏次数/次</Item>
                </List>
                <List className="my-list">
                    <Item extra={<p style={{fontSize:"1.8rem",color:"red"}}>{data.transactionNum}</p>}
                          style={{fontSize:"2.5rem",color:"black"}}>交易次数/次</Item>
                </List>
                <List className="my-list">
                    <Item extra={<p style={{fontSize:"1.8rem",color:"red"}}>{data.purchaseNum}</p>}
                          style={{fontSize:"2.5rem",color:"black"}}>购买次数/次</Item>
                </List>
                <List className="my-list">
                    <Item extra={<p style={{fontSize:"1.8rem",color:"red"}}> {data.visitNum}</p>}
                          style={{fontSize:"2.5rem",color:"black"}}>浏览次数/次</Item>
                </List>

            </div>
        );
    }
}
